#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QtGui>
#include "aboutdialog.h"
#include "optionsdialog.h"
#include "iconsproxy.h"
#include "profile.h"

namespace Ui
{
    class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = 0);
    ~MainWindow();

protected:
    void closeEvent(QCloseEvent *event);

private:
    Ui::MainWindow *ui;
    QTimer timer;
    QLabel *infoLabel;
    QLabel *clockLabel;
    QSystemTrayIcon *trayIcon;
    QMenu *trayIconMenu;
    OptionsDialog *optionsDialog;
    IconsProxy icons;
    QString nick;
    QString gameServer;
    bool    autostart;
    QAction *webAction;
    QAction *profileAction;
    QAction *logAction;
    QAction *postAction;
    QAction *staffAction;
    Profile *profile;

    void initMainWindow();
    void createActions();
    void createConnections();
    void createToolBar();
    void createTrayIcon();
    void writeSettings();
    void readSettings();
    bool userReallyWantsToQuit();

public slots:
    void timeRefresh();
    void writeLog(const int &dest, const QString &text);

private slots:
    void iconActivated(QSystemTrayIcon::ActivationReason reason);
    void aboutBotvaBot();
    void addWeb();
    void addConfig();
    void addLog();
    void addPost();
    void addStaff();
    void options();

    //debug
    void startBot();
    void pauseBot();
    void stopBot();
    void debug1();
    void debug2();
};

#endif // MAINWINDOW_H
